package dataClean;

import java.io.*;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Smartloe
 * @create 2021-05-11 16:24
 */
public class DeleteDuplicatedRow2 {
    public static void main(String[] args) throws IOException {
        FileReader fileReader = new FileReader(new File("C:\\Users\\25392\\Desktop\\Java基础\\src\\main\\java\\dataClean\\data\\deleteduplicatedrows列重复.txt"));

        BufferedReader bufferedReader = new BufferedReader(fileReader);

        Map<String, String> map = new HashMap<String, String> ();

        String readLine = null;

        int i = 0;
        while ((readLine = bufferedReader.readLine()) != null) {
            if (!map.containsValue(readLine)) {
                map.put("key" + i, readLine);
                i++;
            }
        }
        for (int j = 0; j < map.size(); j++) {
            System.out.println(map.get("key"+j));
        }
    }
}
